﻿@model IEnumerable<SchoolManagerMVC.Web.Areas.Courses.ViewModels.CourseViewModel>

@{
    ViewBag.Title = "Courses";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Courses</h2>

<table>
    <tr>
        <th></th>
        <th>
            Course Name
        </th>
        <th>
            Course Number
        </th>
        <th>
            Course Description
        </th>
        <th>
            Teacher
        </th>
        <th>
            Student Count
        </th>
        <th>
            Tuition Cost
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Enrolled Students","Index","Enrollment",new { id = item.course.CourseID },null)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.course.CourseName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.course.CourseNumber)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.course.CourseDescription)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TeacherName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.NumberOfStudents)
        </td>

        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.course.CourseID }) |
            @Html.ActionLink("Details", "Details", new { id = item.course.CourseID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.course.CourseID })
        </td>
    </tr>
}

</table>
<p>
    @Html.ActionLink("Create New", "Create")
</p>